﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Quan_Ly_Phong_Kham_co_len_em
{
    public partial class frmReportNhanVien : Form
    {
        public frmReportNhanVien()
        {
            InitializeComponent();
        }
        //ham ket noi co so du lieu
        public SqlConnection getconnect()
        {
            return new SqlConnection("Data Source=NGUYENTY-PC\\SQLEXPRESS;Initial Catalog=QL_PHONGKHAM;Integrated Security=True");

        }

        private void frmReportNhanVien_Load(object sender, EventArgs e)
        {
            try
            {
                /////////////////////////
                SqlConnection ketnoi = getconnect();
                SqlDataAdapter ad = new SqlDataAdapter("select * from [nhanvien-chucdanh]", ketnoi); //ket noi den co so du lieu de goi ham da khai bao trong StoredProcedure
                DataTable dt = new DataTable();
                ad.Fill(dt);

                
                nhanvien_chucdanhBindingSource.DataSource = dt;
             
                this.reportViewer1.RefreshReport();
            }
            catch { }
        }
    }
}
